import Vue from 'vue'
import 'normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/display.css'
import './styles/element-variables.scss'
import '@/styles/index.scss' // global css

import App from './App'
import router from './router'
import store from './store'
import qs from 'qs'
import md5 from 'js-md5' // 引入md5
import Print from '@/plugs/print'
import VueClipboard from 'vue-clipboard2'
// import echarts from 'echarts';


import VueQr from 'vue-qr'
import html2canvas from 'html2canvas' // 转图片打印需要先安装html2Canvas和print-js
import printJS from 'print-js'

import '@/icons' // icon组件
import '@/permission' // permission control

import components from '@/components' // 注册全局组件
import khReqMethod from '@/utils/khReqMethod' // 注册全局组件
import math from '@/utils/math' // 注册算法
import momentMini from 'moment-mini'
import VueBus from 'vue-bus'

import vuescroll from 'vuescroll'

import axios from 'axios'
Vue.prototype.$axios = axios

Vue.use(Print)
Vue.use(ElementUI)
Vue.use(components)
Vue.use(VueClipboard)
Vue.use(VueQr)
Vue.use(VueBus)
Vue.use(vuescroll)

import * as filter from './filter' // 注册全局filter
Object.keys(filter).forEach(key => {
  Vue.filter(key, filter[key])
})
import * as utils from './utils' // global functions
// register global functions
Object.keys(utils).forEach(key => {
  Vue.prototype['$' + key] = utils[key]
})
import { beforeUploadImg, beforeUploadExcel } from './utils' // 注册全局上传

// eslint-disable-next-line no-undef
Vue.prototype.$echarts = echarts
Vue.prototype.$md5 = md5 // 全局注册md5
Vue.prototype.$qs = qs
Vue.prototype.beforeUploadImg = beforeUploadImg
Vue.prototype.beforeUploadExcel = beforeUploadExcel
Vue.prototype.$momentMini = momentMini// 时间格式化组件
Vue.prototype.$math = math// 算法
Vue.prototype.khReqMethod = khReqMethod// 请求数据方法
Vue.prototype.$html2canvas = html2canvas
Vue.prototype.$printJS = printJS

Vue.config.productionTip = false
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
